﻿Imports System
Imports System.Web
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports System.Text
Imports System.Data.OleDb

Public Class BL


    Public Function GetDataAccess(ByVal _strQry As String, ByVal _sql_con As OleDbConnection) As DataTable

        Dim myOleDbCommand As New OleDbCommand()
        myOleDbCommand = _sql_con.CreateCommand()

        myOleDbCommand.CommandText = _strQry

        _sql_con.Open()
        Dim oldbereader As OleDbDataReader = myOleDbCommand.ExecuteReader()

        Dim _dt As New DataTable()
        _dt.Load(oldbereader)
        _sql_con.Close()
        myOleDbCommand.Dispose()
        Return _dt
    End Function

    Public Sub GetInsertUpdate(ByVal _strQry As String, ByVal _sql_con As OleDbConnection)
        Dim myOleDbCommand As New OleDbCommand()
        myOleDbCommand = _sql_con.CreateCommand()

        myOleDbCommand.CommandText = _strQry

        _sql_con.Open()
        myOleDbCommand.ExecuteNonQuery()

        _sql_con.Close()
        myOleDbCommand.Dispose()
    End Sub

End Class
